<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-10-20 16:06:15
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-12-05 20:10:37
 * @FilePath: /nhw/src/views/Assignment/components/FunctionButton.vue
-->
<template>
  <div class="function-button-container">
    <!-- <div class="left">
      <button @click="onHistory" class="history" v-if="history">
        流程历史
      </button>
    </div> -->
    <div class="right">
      <button
        @click="btnClick(item)"
        v-if="isShow(item)"
        v-for="(item, index) in btnList"
        :key="index"
      >
        {{ item.oprName }}
      </button>
    </div>
  </div>
</template>

<script>
export default {
  name: "FunctionButton",

  data() {
    return {};
  },
  props: {
    // history: {
    //   type: Boolean,
    //   default: true,
    // },
    btnList: {
      type: Array,
      default: () => [],
    },
    ifDefale: {
      type: Boolean,
      default: false,
    },
  },

  mounted() {},

  methods: {
    // onHistory() {
    //   this.$emit("history");
    // },
    btnClick(e) {
      this.$emit("btn-click", e);
    },
    isShow(item) {
      if (this.ifDefale && item.oprName == "延期") {
        return false;
      } else if (item.oprName == "无人认领") {
        return false;
      } else if (item.oprName == "填写一事一档") {
        return false;
      }
      return true;
    },
  },
};
</script>

<style lang="less" scoped>
@import url("~style/mixin.less");
.function-button-container {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  .right {
    display: flex;
    justify-content: flex-end;
    button {
      flex: 1;
      margin: 0 10px;
    }
  }
  button {
    box-sizing: border-box;
    min-width: 160px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 32px;
    height: 70px;
    color: #e16712;
    background: #fff;
    padding: 0 10px;
    &.history {
      color: #e16712;
      background: rgba(231, 158, 109, 0.33);
    }
  }
}
</style>
